package com.spr.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.spr.model.User;

@Controller
@RequestMapping(value="/home")
public class HomeController {
	  @RequestMapping(value="/", method=RequestMethod.GET)
	    public ModelAndView homePage(HttpSession session) {
	            ModelAndView mav = new ModelAndView("home-view");
	            User user = (User) session.getAttribute("UserDetails");
	            mav.addObject(user);
	            return mav;
	    }
}
